﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.ComponentModel;

namespace KTVConsole2.UI
{
    /// <summary>
    /// Interaction logic for WindowSongPlayed.xaml
    /// </summary>
    public partial class WindowSongPlayed : Window
    {
        public WindowSongPlayed()
        {
            InitializeComponent();
            userControlSongPlayedDisplayBySong1.listView1.Items.Clear();
            userControlSongPlayedDisplayBySong1.listView1.ItemsSource = MainWindow.Sm.GetAll();
            SortDescriptionCollection sdc = userControlSongPlayedDisplayBySong1.listView1.Items.SortDescriptions;
            sdc.Add(new SortDescription("Frequency", ListSortDirection.Descending));
            
            userControlSongPlayedDisplayByStar1.lvStarList.Items.Clear();
            userControlSongPlayedDisplayByStar1.lvStarList.ItemsSource = MainWindow.Sm.GetFavoriteStars();
        }

        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            MainWindow.Sm.SaveToXml();
            Util.Util.TellUser("保存成功！");
        }
    }
}
